<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="ty" tagdir="/WEB-INF/tags"%>

<!DOCTYPE html>
<html lang="zh">
	<head>
		<%@ include file="../common/head.jsp" %>
		<title>${empty article ? '添加' : '编辑'}文章-后台管理系统</title>
		<script type="text/javascript" src="/manager/js/article.js"></script>
	</head>
	<ty:right>
		<div class="page-header">
			<h1>${empty article ? '添加' : '编辑'}文章</h1>
		</div>
		<form action="${empty article ? 'add' : 'edit'}.action" forward="manage.action" 
			id="validForm" class="form-horizontal">
			<input type="hidden" name="id" id="id" value="${article.id}" />
			
			<div class="form-group">
				<label class="col-sm-2 control-label no-padding-right">文章标题：</label>
				<div class="col-sm-10">
			        <input type="text" name="title" class="col-xs-10 col-sm-5" datatype="*1-128" value="${article.title}" placeholder="请填写文章标题"/>
					<span class="validform_tip control-label"></span>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label no-padding-right">文章封面：</label>
				<div class="col-sm-10">
					<ty:imageUpload name="cover" clip="true" multi="false" required="true"></ty:imageUpload>
					<span class="validform_tip control-label"></span>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label no-padding-right">文章概要：</label>
				<div class="col-sm-10">
			        <textarea name="outline" class="col-xs-10 col-sm-5" datatype="*1-1024" placeholder="请填写概要">${article.outline}</textarea>
					<span class="validform_tip control-label"></span>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label no-padding-right">文章内容：</label>
				<div class="col-sm-10">
			        <textarea id="content" name="content" class="col-xs-10 col-sm-10" datatype="*" style="padding: 0;">${article.content}</textarea>
				</div>
			</div>
			<div class="clearfix">
				<div class="col-md-offset-3 col-md-9"> 
					<button type="submit" class="btn btn-info" type="button">
						<i class="ace-icon fa fa-check bigger-110"></i>
						提交
					</button>
					<button id="returnBtn" type="button" class="btn btn-info" type="button">
						<i class="ace-icon fa fa-close bigger-110"></i>
						取消
					</button>
				</div>
			</div>
		</form>
	</ty:right>
</html>